﻿using MVC_Project.BLL;
using Project.DAL;
using Project.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.BLL
{
    public class DDmanageDetailBll : BaseBll<DDmanageDetail>
    {
        public override void SetDal()
        {
            Dal = new DDmanageDetailDal();
        }
        public List<DDmanageDetail> GetDDmanage()
        {
            return base.Query().ToList();
        }

        public bool DeleteDDmanage(int id)
        {
            var ddmanage = Dal.Query().Where(u => u.detail_id == id).FirstOrDefault();


            if (ddmanage != null)
            {
                Dal.Delete(ddmanage);
                return Dal.SaveChanges();
            }
            else
            {
                return false;
            }
        }
    }
}
